<?xml version="1.0" encoding="UTF-8" ?>
<%@page import="cn.lily.esb.monitor.web.session.MonitorSessionHelper"%>
<%@page import="cn.lily.esb.monitor.spe.MonitorSPE"%>
<%@ page import="cn.lily.com.configure.util.ESBSetting"%>
<%@ page import="cn.lily.esb.monitor.config.menu.MonitorMenuSetting"%>
<%@ page import="cn.lily.esb.monitor.config.MonitorSetting"%>
<%@ page import="cn.lily.esb.monitor.config.menu.MonitorMenu"%>
<%@ page import="cn.lily.esb.monitor.config.MonitorPath"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String first = request.getParameter("first");
	String second = request.getParameter("second");	
	String monitorParam = request.getParameter("monitorParam");
	boolean isPortal = false;
	if(first == null || first.equals("")){
		first = "0";
	}
	if(second == null|| second.equals("")){
		second = "0";
	}
	if(monitorParam != null && !monitorParam.equals("")){
		isPortal = true;
		String[] params = monitorParam.split(",");
		first = params[0];
		second = params[1];
	}
	
	MonitorMenu menu = MonitorMenuSetting.getMonitorMenu(first).getChildMenu(second);
	
	//放置当前系统的授权信息
	if(session.getAttribute("monitorAppAuth") == null){
		MonitorSessionHelper.resetAllSession(session);
	}
	
	if(session.getAttribute("monitorRefreshTime") == null){
		session.setAttribute("monitorRefreshTime", MonitorSetting.getString("webRefreshTime"));
	}
	
	String monitorAppAuth = (String)session.getAttribute("monitorAppAuth");
	String monitorAppIP = (String)session.getAttribute("monitorAppIP");
	String monitorAppPort = (String)session.getAttribute("monitorAppPort");
	String monitorAppSSL = (String)session.getAttribute("monitorAppSSL");
	String monitorAppCount = (String)session.getAttribute("monitorAppCount");
	String monitorRefreshTime = (String)session.getAttribute("monitorRefreshTime");
	String monitorAppUrl = (String)session.getAttribute("monitorAppUrl");
	String isWebRefresh = MonitorSetting.getString("isWebRefresh");
		
%>
<!DOCTYPE HTML>
<html>
<head>
	<title>Home</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
	
	<!-- Bootstrap Core CSS -->
	<link href="<%=MonitorPath.getCSSForderPath()%>/bootstrap_2.min.css" rel='stylesheet' type='text/css' />
	<!-- Custom CSS -->
	<link href="<%=MonitorPath.getCSSForderPath()%>/style.css" rel='stylesheet' type='text/css' />
	<!-- Graph CSS -->
	<link href="<%=MonitorPath.getCSSForderPath()%>/lines.css" rel='stylesheet' type='text/css' />
	<link href="<%=MonitorPath.getFontAwesomePath()%>" rel="stylesheet"> 
	<!-- jQuery -->
	<script src="<%=MonitorPath.getJSForderPath()%>/jquery.min.js"></script>	
	
	<!-- 统计图 -->
	<script src="/<%=ESBSetting.getString("appCode")%>/public/js/common/esl.js"></script>
	<script src="/<%=ESBSetting.getString("appCode")%>/public/js/common/codemirror.js"></script>
	<script src="/<%=ESBSetting.getString("appCode")%>/public/js/common/echarts-all.js"></script>
	<script src="/<%=ESBSetting.getString("appCode")%>/public/js/develop/component/report/ECharts.js"></script>
			
	<!-- 监控部分 -->
	<script src="<%=MonitorPath.getJSForderPath()%>/lily.monitor.js"></script>
	<script type="text/javascript">
		window.monitorAppAuth = '<%=monitorAppAuth%>';
		window.monitorAppIP='<%=monitorAppIP%>';
		window.monitorAppPort='<%=monitorAppPort%>';
		window.monitorAppSSL='<%=monitorAppSSL%>';
		window.monitorAppCount='<%=monitorAppCount%>';
		window.monitorRefreshTime = '<%=monitorRefreshTime%>';
		window.isRefresh = '<%=isWebRefresh%>';
		window.monitorAppUrl='<%=monitorAppUrl%>';
	</script>
	
</head>
<body>
		
	<div id="wrapper">
		<!-- 导航+右侧菜单 -->
		
		<%if(!isPortal){%>
			<jsp:include page="monitor_nav.jsp" >
				<jsp:param value="<%=first%>" name="first"/>
				<jsp:param value="<%=second%>" name="second"/>
			</jsp:include>		
		<%}%>
		
		<%if(!isPortal){%>
		
			<!-- 内容 -->
			<div id="page-wrapper" style="min-height: 305px;background: #f2f4f8 none repeat scroll 0 0;">
				<% if(menu==null){ %>
					
				<% }else{ %>
					<jsp:include page="<%=menu.getSrc()%>"/>  
				<% } %>			
			</div>	
		
		<%}else{ %>
		
			<% if(menu==null){ %>
					
			<% }else{ %>
				<jsp:include page="<%=menu.getSrc()%>"/>  
			<% } %>	
		
		<%}%>
		
	</div>
	
	<!-- Nav CSS -->
	<link href="<%=MonitorPath.getCSSForderPath()%>/custom.css" rel="stylesheet">
	<!-- Metis Menu Plugin JavaScript -->
	<script src="<%=MonitorPath.getJSForderPath()%>/metisMenu.min.js"></script>
	<script src="<%=MonitorPath.getJSForderPath()%>/custom.js"></script>
	<script src="<%=MonitorPath.getJSForderPath()%>/bootstrap_2.min.js"></script>
	
	<!-- 扩展CSS -->
	<link href="<%=MonitorPath.getCSSForderPath()%>/plugins.css" rel='stylesheet' type='text/css' />
	
</body>
</html>